import 'package:flutter/material.dart';

class OrderList extends StatelessWidget {
  const OrderList({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('订单列表'),
        backgroundColor: Colors.purple,
        centerTitle: true,
      ),
      body: Container(
        alignment: Alignment.center,
        child: Column(
          children: [
            GestureDetector(
              onTap: () {
                Navigator.pushNamed(
                  context, // 上下文
                  '/orderDetail', // 路由名称
                  arguments: {'id': '123'}, // 参数
                );
              },
              child: Image.asset('open_eyes.png'),
            ),
            TextButton(
              onPressed: () {
                Navigator.pushNamed(context, '/orderDetail');
              },
              child: const Text('去详情页'),
            ),
          ],
        ),
      ),
    );
  }
}
